package cn.wen.util;

import java.awt.Color;
import java.awt.Graphics;
import java.util.Random;

/**
* @ClassName: LineDisruptor
* @Description: 干扰线
* @author Gavin Nie  
* @e-mail Nie_ZW@163.com
* @date 2014年7月6日 上午10:30:05
*/ 
public class LineDisruptor implements Disruptor
{
	@Override
	public Graphics getDisruptor(Graphics grap, int size)
	{
		Random random = new Random();
		for (int i = 0; i < size; i++)
		{
			int x = random.nextInt(IdentifyCodeUtil.WIDTH);
			int y = random.nextInt(IdentifyCodeUtil.HEIGHT);
			grap.setColor(new Color(random.nextInt(255),random.nextInt(255),random.nextInt(255)));
			grap.drawLine(x, y, x*2, y*2);
		}
		return grap;
	}
}
